<!-- Horizontal Form -->
 <div class="box box-info">
      <div class="box-header with-border">
        <h3 class="box-title">修改密码</h3>
      </div>
      <!-- /.box-header -->
      <!-- form start -->
      <form class="form-horizontal">
        <div class="box-body">
          <div class="form-group">
            <label for="pwdId" class="col-sm-2 control-label">原密码</label>
            <div class="col-sm-10">
              <input type="password" class="form-control" name="password" id="pwdId" placeholder="原密码">
            </div>
          </div>
          <div class="form-group">
            <label for="newPwdId" class="col-sm-2 control-label">新密码</label>

            <div class="col-sm-10">
              <input type="password" class="form-control" name="newPwd" id="newPwdId" placeholder="新密码">
            </div>
          </div>
          <div class="form-group">
            <label for="cfgPwdId" class="col-sm-2 control-label">密码确认</label>

            <div class="col-sm-10">
              <input type="password" class="form-control" name="cfgPwd" id="cfgPwdId" placeholder="密码确认">
            </div>
          </div>
         
        </div>
        <!-- /.box-body -->
        <div class="box-footer">
          <button type="button" class="btn btn-default btn-cancel">Cancel</button>
          <button type="button" class="btn btn-info pull-right btn-save">Save</button>
        </div>
        <!-- /.box-footer -->
      </form>
    </div>
<script type="text/javascript">
   $(function(){
	   $(".box-footer")
	   .on("click",".btn-cancel",doCancel)
	   .on("click",".btn-save",doUpdateObject)
   });
   function doCancel(){
	   $("#mainContentId").html("");
   }
   function doUpdateObject(){
	   //1.获取用户提交数据
	   var params={pwd:$("#pwdId").val(),
	              newPwd:$("#newPwdId").val(),
	              cfgPwd:$("#cfgPwdId").val()
	   }
	   //2.定义请求的url
	   var url="user/doUpdatePassword"
	   //3.异步提交请求,执行更新操作
	   $.post(url,params,function(result){
		    if(result.state==1){
			 alert(result.message);
			//location.href="doLoginUI?t="+Math.random();
			 location.href="doLogout?t="+Math.random();
		    }else{
			 alert(result.message);
		    }
	   })
   }
</script>

    
    